package com.elinkway.infinitemovies.bigdata;

import com.lvideo.http.bean.LVideoBaseBean;
import com.lvideo.http.bean.LVideoDataHull;

import java.util.Map;

/**
 * 页面展示统计
 */
public class BigDataPageShowTask extends BigDataBaseTask {
    /**
     * 设置当前页面标示
     * @param curUrl
     * @return
     */
    public BigDataPageShowTask setCurUrl(String curUrl) {
        putParam("cur_url", curUrl);
        return this;
    }

    public BigDataPageShowTask setParamMap(Map<String, String> map) {
        setMap(map);
        return this;
    }

    /**
     * 设置网络类型
     *
     * @param netType
     * @return
     */
    public BigDataPageShowTask setNT(String netType) {
        putParam("nt", netType);
        return this;
    }

    @Override
    public boolean execute() {
        LVideoDataHull<LVideoBaseBean> d = BigDataApi.postPageShow(getParam("cur_url"), getParamMap());
        return d.getDataType() == LVideoDataHull.DataType.DATA_PARSER_IS_NULL;
    }
}
